package bz.ziro.kanbe.model;

import java.io.Serializable;
import java.util.Date;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;

@Model
public class Page implements Serializable {

    private static final long serialVersionUID = 1L;

    @Attribute(primaryKey = true)
    private Key key;

    @Attribute(version = true)
    private Long version;

    private Integer schemaVersion = 1;

    @Attribute
    private String name;
    @Attribute
    private String detail;
    @Attribute
    private Integer priority;

    @Attribute
    private Key parentPageKey;
    @Attribute
    private Key siteTemplateKey;
    @Attribute
    private Key pageTemplateKey;

    @Attribute
    private Key siteKey;

    @Attribute(lob = true)
    private String siteData;
    @Attribute(lob = true)
    private String pageData;

    @Attribute
    private User creator;
    @Attribute
    private Date createDate;
    @Attribute
    private User editor;
    @Attribute
    private Date editDate;

    /**
     * Returns the key.
     *
     * @return the key
     */
    public Key getKey() {
        return key;
    }

    /**
     * Sets the key.
     *
     * @param key
     *            the key
     */
    public void setKey(Key key) {
        this.key = key;
    }

    /**
     * Returns the version.
     *
     * @return the version
     */
    public Long getVersion() {
        return version;
    }

    /**
     * Sets the version.
     *
     * @param version
     *            the version
     */
    public void setVersion(Long version) {
        this.version = version;
    }

    /**
     * Returns the schema version.
     *
     * @return the schema version
     */
    public Integer getSchemaVersion() {
        return schemaVersion;
    }

    /**
     * Sets the schema version.
     *
     * @param schemaVersion
     *            the schema version
     */
    public void setSchemaVersion(Integer schemaVersion) {
        this.schemaVersion = schemaVersion;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public User getCreator() {
        return creator;
    }

    public void setCreator(User creator) {
        this.creator = creator;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public User getEditor() {
        return editor;
    }

    public void setEditor(User editor) {
        this.editor = editor;
    }

    public Date getEditDate() {
        return editDate;
    }

    public void setEditDate(Date editDate) {
        this.editDate = editDate;
    }

    /**
     * @param pageSite セットする pageSite
     */
    public void setSiteKey(Key siteKey) {
        this.siteKey = siteKey;
    }

    /**
     * @return pageSite
     */
    public Key getSiteKey() {
        return siteKey;
    }

    /**
     * @param pageTemplateKey セットする pageTemplateKey
     */
    public void setPageTemplateKey(Key pageTemplateKey) {
        this.pageTemplateKey = pageTemplateKey;
    }

    /**
     * @return pageTemplateKey
     */
    public Key getPageTemplateKey() {
        return pageTemplateKey;
    }

    /**
     * @param siteTemplateKey セットする siteTemplateKey
     */
    public void setSiteTemplateKey(Key siteTemplateKey) {
        this.siteTemplateKey = siteTemplateKey;
    }

    /**
     * @return siteTemplateKey
     */
    public Key getSiteTemplateKey() {
        return siteTemplateKey;
    }

    public Key getParentPageKey() {
        return parentPageKey;
    }

    public void setParentPageKey(Key parentPageKey) {
        this.parentPageKey = parentPageKey;
    }

    /**
     * @param siteData セットする siteData
     */
    public void setSiteData(String siteData) {
        this.siteData = siteData;
    }

    /**
     * @return siteData
     */
    public String getSiteData() {
        return siteData;
    }

    /**
     * @param pageData セットする pageData
     */
    public void setPageData(String pageData) {
        this.pageData = pageData;
    }

    /**
     * @return pageData
     */
    public String getPageData() {
        return pageData;
    }

    /**
     * @param priority セットする priority
     */
    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    /**
     * @return priority
     */
    public Integer getPriority() {
        return priority;
    }
}
